<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="/restrito/layout/template.xhtml" >

    <ui:define name="content">
        <h:form>

            <rich:panel>

                <f:facet name="header">
                    <h:outputText value="Lista Pessoas"/>
                </f:facet>
                <p align="center">
                <rich:dataTable value="#{pessoaController.carregarPessoas()}" var="item">

                    <rich:column>
                        <f:facet name="header">
                            <h:outputText value="Nome"/>
                        </f:facet>
                        <h:outputText value="#{item.nome}"/>
                    </rich:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Cpf"/>
                        </f:facet>
                        <h:outputText value="#{item.cpf}"/>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Sexo"/>
                        </f:facet>
                        <h:outputText value="#{item.sexo}"/>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Telefone"/>
                        </f:facet>
                        <h:outputText value="#{item.telefone}"/>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Endereco"/>
                        </f:facet>
                        <h:outputText value="#{item.endereco}"/>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Login"/>
                        </f:facet>
                        <h:outputText value="#{item.login}"/>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Senha"/>
                        </f:facet>
                        <h:outputText value="#{item.senha}"/>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Remover"/>
                        </f:facet>
                        <h:commandButton action="#{pessoaController.deletarPessoa()}" value="Excluir"/>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Editar"/>
                        </f:facet>
                        <h:commandButton action="#{pessoaController.editar}" value="Editar"/>
                    </h:column>


                </rich:dataTable>
                </p>

            </rich:panel>
        </h:form>
    </ui:define>
</ui:composition>